package class

import "fmt"

// Dog 类型定义/**
type Dog struct {
	name   string
	age    int
	color  string
	master string
}

func HAHA(ss string) {
	fmt.Println(ss)

}

// GetDog 获取一个新的对象 /**
func GetDog(name string, age int, color string, master string) Dog {
	newDog := new(Dog)
	newDog.name = name
	newDog.age = age
	newDog.color = color
	newDog.master = master
	return *newDog
}

//会是同一个对象吗
// 狗狗的看门方法

func LookDoor(message string, dog Dog) {

	printDogMessage(dog)
	fmt.Println(message)

}

// 私有函数，打印狗狗的具体信息。
func printDogMessage(dog Dog) {
	fmt.Println("dog.name:", dog.name)
	fmt.Println("dog.age:", dog.age)
	fmt.Println("dog.color:", dog.color)
	fmt.Println("dog.master:", dog.master)
}
